<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .input-item:focus-within{
            background-color: violet;
        }
    </style>
</head>
<body>

    <!-- within css选择器 就是当前元素即其内部元素符合条件时触发 -->

    
    <div class="input-item">
        <input type="text" class="input">
    </div>
</body>
</html>